package pe.com.mowa.siscobsms.servlets;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import pe.com.mowa.siscobsms.bean.analista;
import pe.com.mowa.siscobsms.datos.conAnalista;

/**
 * Servlet implementation class setLocal
 */
public class setLocal extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public setLocal() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
 	    PrintWriter out = response.getWriter();
 	    
 	    String nombre = request.getParameter("nomLocal");
 	    String direccion = request.getParameter("dirLocal");
	    
 	    out.println("<script>");
	    out.println("alert('registro correcto');");
	    out.println("</script>");
	    
	    conAnalista cl = new conAnalista();
	    
	    analista loc = new analista();
	    loc.setNombre(nombre);
	    loc.setDireccion(direccion);
	    
	    
	    
	    try {
			cl.setLocal(loc);
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	    out.close();

		
		
	}

}
